/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.fgv.erp.modelo;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author adao
 */
@Entity
@Table(name = "Marketing")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Marketing.findAll", query = "SELECT m FROM Marketing m"),
    @NamedQuery(name = "Marketing.findByMarketing", query = "SELECT m FROM Marketing m WHERE m.marketing = :marketing"),
    @NamedQuery(name = "Marketing.findByDataInclussao", query = "SELECT m FROM Marketing m WHERE m.dataInclussao = :dataInclussao"),
    @NamedQuery(name = "Marketing.findByEmail", query = "SELECT m FROM Marketing m WHERE m.email = :email"),
    @NamedQuery(name = "Marketing.findByNome", query = "SELECT m FROM Marketing m WHERE m.nome = :nome"),
    @NamedQuery(name = "Marketing.findByTelefone", query = "SELECT m FROM Marketing m WHERE m.telefone = :telefone")})
public class Marketing implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "marketing")
    private Long marketing;
    @Column(name = "dataInclussao")
    @Temporal(TemporalType.DATE)
    private Date dataInclussao;
    // @Pattern(regexp="[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?", message="E-mail inválido")//if the field contains email address consider using this annotation to enforce field validation
    @Size(max = 255)
    @Column(name = "email")
    private String email;
    @Size(max = 255)
    @Column(name = "nome")
    private String nome;
    @Size(max = 255)
    @Column(name = "telefone")
    private String telefone;

    public Marketing() {
    }

    public Marketing(Long marketing) {
        this.marketing = marketing;
    }

    public Long getMarketing() {
        return marketing;
    }

    public void setMarketing(Long marketing) {
        this.marketing = marketing;
    }

    public Date getDataInclussao() {
        return dataInclussao;
    }

    public void setDataInclussao(Date dataInclussao) {
        this.dataInclussao = dataInclussao;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    public String getTelefone() {
        return telefone;
    }

    public void setTelefone(String telefone) {
        this.telefone = telefone;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (marketing != null ? marketing.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Marketing)) {
            return false;
        }
        Marketing other = (Marketing) object;
        if ((this.marketing == null && other.marketing != null) || (this.marketing != null && !this.marketing.equals(other.marketing))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.com.fgv.erp.modelo.Marketing[ marketing=" + marketing + " ]";
    }
    
}
